{include file="header.html"}
<style type="text/css">
.profile-info-value{
	width: 34%;
}
</style>
<div class="page-header">
	<h6>
		订单管理
		<small>
			<i class="ace-icon fa fa-angle-double-right"></i>
			订单详情
		</small>
	</h6>
</div><!-- /.page-header -->

<div class="row">
<div class="col-xs-12">
	<form class="form-horizontal" role="form" method="post" action="?app=order&act=edit" enctype="multipart/form-data" id="form">
	<input type="hidden" id="id" name="id" value="{$row->id}" />
	<input type="hidden" id="oldstatus" name="oldstatus" value="{$row->status}" />
	<input type="hidden" id="see" name="see" value="{$row->see}" />
	<div class="profile-user-info profile-user-info-striped">
		<div class="profile-info-row">
				<div class="profile-info-name" style="background:none;"> </div>
				<div class="profile-info-value">
					<span><h4 style="text-align:right;">会员信息</h4></span>
				</div>
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 下单人 </div>
			<div class="profile-info-value">
				<span>{$row->member_name}</span>
			</div>
			<div class="profile-info-name"> 下单人电话 </div>
			<div class="profile-info-value">
				<span>{$row->mobile}</span>
			</div>
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 下单时间 </div>
			<div class="profile-info-value">
				<span>{$row->add_time|date_format:"%Y-%m-%d %H:%I:%S"}</span>
			</div>
		</div>
	</div>
	<div class="profile-user-info profile-user-info-striped">
		<div class="profile-info-row">
				<div class="profile-info-name" style="background:none;"> </div>
				<div class="profile-info-value">
					<span><h4 style="text-align:right;">订单信息</h4></span>
				</div>
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> ID </div>
			<div class="profile-info-value">
				<span>{$row->id}</span>
			</div>
			<div class="profile-info-name"> 订单号 </div>
			<div class="profile-info-value">
				<span>{$row->order_sn}</span>
			</div>
		</div>
				<div class="profile-info-row">
			<div class="profile-info-name"> 支付时间 </div>
			<div class="profile-info-value">
				<span>{if $row->pay_time} {$row->pay_time|date_format:"%Y-%m-%d %H:%I:%S"}{/if}</span>
			</div>
			<div class="profile-info-name"> 使用佣金支付 </div>
			<div class="profile-info-value">
				<span>{$row->used_commission}</span>
			</div>
			
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 支付方式 </div>
			<div class="profile-info-value">
				<span>{if $row->pay_method == 'wxpay'}APP内微信支付 
				{else if $row->pay_method == 'wxpay_h5'}服务号内支付 
				{else if $row->pay_method == 'alipay'}支付宝支付
				{else if $row->pay_method == 'integral'}积分兑换{/if}</span>
			</div>
			<div class="profile-info-name"> 使用余额支付 </div>
			<div class="profile-info-value">
				<span>{$row->used_money}</span>
			</div>
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 快递公司 </div>
			<div class="profile-info-value" style="vertical-align: middle;">
				<span>
					<input type="text" name="shipping_company" id="shipping_company" value="{$row->shipping_company}" class="col-xs-3" style="width:122px;"/>
				</span>
			</div>
			<div class="profile-info-name"> 快递单号 </div>
			<div class="profile-info-value">
				<span><input type="text" name="shipping_number" id="shipping_number" value="{$row->shipping_number}" class="col-xs-6" style="width:122px;"/></span>
			</div>
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 使用优惠劵支付 </div>
			<div class="profile-info-value">
				<span>{$row->used_coupon}</span>
			</div>
			<div class="profile-info-name"> 状态 </div>
			<div class="profile-info-value">
				<span><select name="status" id="status" style="width:122px; onchange="show()"">
				{if $row->status >= 0}
				<option value="">请选择</option>
				<option value="0" {if $row->status==0}selected{/if}>未支付</option>
				{if $row->status == 0}
				{else}
				<option value="1" {if $row->status==1}selected{/if}>已支付</option>
				<option value="2" {if $row->status==2}selected{/if}>已发货</option>
				<option value="3" {if $row->status==3}selected{/if}>完成（已收货）</option>
				<option value="4" {if $row->status==4}selected{/if}>完成（已评价）</option>
				{/if}
				<option value="-1" {if $row->status==-1}selected{/if}>取消</option>
				<option value="-2" {if $row->status==-2}selected{/if}>退款</option>
				<option value="-3" {if $row->status==-2}selected{/if}>退货</option>
				{else if $row->status==-1}
					<option value="-1" selected >取消</option>
				{else if $row->status==-2}
					<option value="-2" selected >退款</option>
				{else if $row->status==-3}
					<option value="-3" selected >退款</option>
				{/if}
				</select></span>
				<input type="hidden" name="origin_status" id="origin_status" value="{$row->status}" />
			</div>
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 运费 </div>
			<div class="profile-info-value">
				<input type="text" name="shipping_price" id="shipping_price" value="{$row->shipping_price}" class="col-xs-3" style="width:122px;"/>
			</div>
			<div class="profile-info-name"> {if $row->integral_order==1}订单总积分{else}订单总价{/if} </div>
			<div class="profile-info-value">
				<input type="text" name="total_price" id="total_price" value="{if $row->integral_order==1}{intval($row->total_price)}{else}{$row->total_price}{/if}" class="col-xs-3" style="width:122px;"/><span style="line-height: 32px;padding-left: 10px;"> {if $row->integral_order==1}积分{else}元{/if}</span>
			</div>
			
		</div>
		{foreach from =$goods key=k item=rs}
		<div>
			商品{$k+1}
			<input type="hidden" name="goods[]" id="goods{$k}" value="{$rs->id}" />
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 商品图 </div>
			<div class="profile-info-value">
				<span><img src="{$rs->goods_pic}" style="width:100px;"></span>
			</div>
			<div class="profile-info-name"> 商品名称 </div>
			<div class="profile-info-value">
				<span>{$rs->goods_name}</span>
			</div>
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 商品规格 </div>
			<div class="profile-info-value">
				<span>{$rs->spec}</span>
			</div>
			<div class="profile-info-name"> {if $row->integral_order==1}商品积分{else}商品单价{/if} </div>
			<div class="profile-info-value">
				<input type="text" name="price[]" id="price{$k}" value="{if $row->integral_order==1}{intval($row->total_price)}{else}{$row->total_price}{/if}" class="col-xs-3 price" onchange="onCh()" style="width:122px;"/><span style="line-height: 32px;padding-left: 10px;"> {if $row->integral_order==1}积分{else}元{/if}</span>
				<input type="hidden" name="" value="{$rs->quantity}" class="quantity">
				<input type="hidden" name="" value="{$rs->price}" class="tol">
			</div>
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 商品数量 </div>
			<div class="profile-info-value">
				<span>{$rs->quantity}</span>
			</div>
			<div class="profile-info-name"> 门店 </div>
			<div class="profile-info-value">
				<span>{$rs->shop_name}</span>
			</div>
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 评价星级： </div>
			<div class="profile-info-value">
				<span>
					{if $rs->comment_content} 
						{$rs->comment_stars}星 &nbsp;&nbsp;&nbsp;&nbsp; 评论时间：{$rs->comment_time|date_format:"%Y-%m-%d %H:%I:%S"} 
					{/if}
				</span>
			</div>
			<div class="profile-info-name"> 评价内容 </div>
			<div class="profile-info-value">
				<textarea name="comment_content" id="comment_content" rows="3" style="width:100%" disabled>{$rs->comment_content}</textarea>
			</div>
		</div>
		{foreachelse}
		{/foreach}
	</div>
	<div class="profile-user-info profile-user-info-striped">
		<div class="profile-info-row">
				<div class="profile-info-name" style="background:none;"> </div>
				<div class="profile-info-value">
					<span><h4 style="text-align:right;">收货信息</h4></span>
				</div>
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 收货人姓名 </div>
			<div class="profile-info-value" >
				<span>{$row->name}</span>
			</div>
			<div class="profile-info-name"> 邮政编码 </div>
			<div class="profile-info-value">
				<span>{$row->zipcode}</span>
			</div>
		</div>
		<div class="profile-info-row">
			<div class="profile-info-name"> 地区 </div>
			<div class="profile-info-value" style="vertical-align: middle;">
				<span>
					{$row->province}{$row->city}{$row->district}
				</span>
			</div>
			<div class="profile-info-name"> 地址 </div>
			<div class="profile-info-value">
				<span><input type="text" name="address" id="address" value="{$row->address}" class="col-xs-6" style="width:100%;"/></span>
			</div>
		</div>
	</div>
	<input type="hidden" name="print" id="print" value="" />
	<div class="clearfix form-actions">
		<div class="col-md-offset-3 col-md-9">
			<button class="btn btn-info" type="submit">
				<i class="ace-icon fa fa-check bigger-110"></i>
				提交
			</button>

			&nbsp; &nbsp; &nbsp;
			<button class="btn" type="reset">
				<i class="ace-icon fa fa-undo bigger-110"></i>
				重置
			</button>

			&nbsp; &nbsp; &nbsp;
			<button class="btn btn-info" type="button" onclick="javascript:history.go(-1)">
				<i class="ace-icon fa fa-check bigger-110"></i>
				返回
			</button>
			&nbsp; &nbsp; &nbsp;
			<button class="btn"  id="sub" >
				<i class="ace-icon fa fa-print bigger-120"></i>
				打印发货单
			</button>
		</div>
	</div>
	</form>
</div>
</div>

{include file="footer.html"}
<script type="text/javascript">
$(function(){
	function add(){
		var all = 0;
		$('.tol').each(function(){
			var cc = 0;
			var cc = parseFloat($(this).val());
			all = all+cc;
		});
		$('#total_price').val(all);
}
	$(".price").blur(function(){
		var a = $(this).val();
		var b = $(this).siblings('.quantity').val();
		var c =a*b;
		$(this).siblings('.tol').val(c);
		add();
	})
})

	$(function(){

		$('#sub').click(function(){
			$('#print').attr('value','1');
			$('#form').submit();
		});
		$('#status').click(function(){
			var x=document.getElementById('status').value;
			if(x > 0){
				$('#sub').show();
			}else{
				$('#sub').hide();
			}
		})
		if({$row->status} > 0){
			$('#sub').show();
		}else{
			$('#sub').hide();
		}


	})
</script>
